package com.gx.smart.construction.ui.area.adapter;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import androidx.recyclerview.widget.RecyclerView;

import com.gx.smart.base.BaseAdapter;
import com.gx.smart.construction.R;
import com.gx.wisestone.constructionappgrpclib.grpc.systenant.ConstructionAppSysTenantDto;

import javax.inject.Inject;

import dagger.hilt.android.qualifiers.ActivityContext;

/**
 * @author xiaosy
 * @create 2019-11-20
 * @Describe
 **/
public class AreaAdapter extends BaseAdapter<ConstructionAppSysTenantDto, AreaAdapter.ViewHolder> {

    @Inject
    public AreaAdapter(@ActivityContext Context context) {
        super(context);
    }

    @Override
    protected int onBindLayout() {
        return R.layout.item_area_layout;
    }

    @Override
    protected ViewHolder onCreateHolder(View view) {
        return new ViewHolder(view);
    }

    @Override
    protected void onBindData(ViewHolder holder, ConstructionAppSysTenantDto item, int position) {
        holder.areaName.setText(item.getName());
    }


    public class ViewHolder extends RecyclerView.ViewHolder {
        private TextView areaName;


        ViewHolder(View itemView) {
            super(itemView);
            areaName = (TextView) itemView.findViewById(R.id.areaName);
        }
    }

}
